﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace server_logic_simulator
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            DataModel.LoadDataFromExcel(AppDomain.CurrentDomain.BaseDirectory + "DataExcel.xls");
            this.dataGridView1.DataSource = DataModel.mDataset.Tables["人物"];
            this.dataGridView2.DataSource = DataModel.mDataset.Tables["职业"];
            this.dataGridView3.DataSource = DataModel.mDataset.Tables["技能"];
            this.dataGridView4.DataSource = DataModel.mDataset.Tables["装备"];
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.dataGridView1.Update();
            this.dataGridView2.Update();
            this.dataGridView3.Update();
            this.dataGridView4.Update();
            DataModel.SaveDataTableToExcel(AppDomain.CurrentDomain.BaseDirectory + "DataExcel.xls");
        }


    }
}
